package com.eastjet.maintenance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 编码规则表
 * @TableName device_rules
 */
@TableName(value ="device_rules")
@Data
public class DeviceRules implements Serializable {
    /**
     * 编码编号
     */
    @TableId(type = IdType.AUTO)
    private Integer rulesId;

    /**
     * 表单名称
     */
    private String rulesFromname;

    /**
     * 字母前缀
     */
    private String rulesLetter;

    /**
     * 时间格式(0-yyyy 1-yyyymm 2-yyyymmdd 3-yyyymmddhhmm 4-yyyymmddhhmmss 5-null )
     */
    private Integer rulesTimeType;

    /**
     * 编码后缀(0-001  1-0001  2-00001)
     */
    private Integer rulesNum;

    /**
     * 步长(0-年 1-月  2-日 3-空)
     */
    private Integer step;

    /**
     * 备注
     */
    private String notes;

    /**
     * 创建人
     */
    private String insertPerson;

    /**
     * 创建时间
     */
    private Date insertTime;

    /**
     * 更新人
     */
    private String updatePerson;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 逻辑删除
     */
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceRules other = (DeviceRules) that;
        return (this.getRulesId() == null ? other.getRulesId() == null : this.getRulesId().equals(other.getRulesId()))
            && (this.getRulesFromname() == null ? other.getRulesFromname() == null : this.getRulesFromname().equals(other.getRulesFromname()))
            && (this.getRulesLetter() == null ? other.getRulesLetter() == null : this.getRulesLetter().equals(other.getRulesLetter()))
            && (this.getRulesTimeType() == null ? other.getRulesTimeType() == null : this.getRulesTimeType().equals(other.getRulesTimeType()))
            && (this.getRulesNum() == null ? other.getRulesNum() == null : this.getRulesNum().equals(other.getRulesNum()))
            && (this.getStep() == null ? other.getStep() == null : this.getStep().equals(other.getStep()))
            && (this.getNotes() == null ? other.getNotes() == null : this.getNotes().equals(other.getNotes()))
            && (this.getInsertPerson() == null ? other.getInsertPerson() == null : this.getInsertPerson().equals(other.getInsertPerson()))
            && (this.getInsertTime() == null ? other.getInsertTime() == null : this.getInsertTime().equals(other.getInsertTime()))
            && (this.getUpdatePerson() == null ? other.getUpdatePerson() == null : this.getUpdatePerson().equals(other.getUpdatePerson()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRulesId() == null) ? 0 : getRulesId().hashCode());
        result = prime * result + ((getRulesFromname() == null) ? 0 : getRulesFromname().hashCode());
        result = prime * result + ((getRulesLetter() == null) ? 0 : getRulesLetter().hashCode());
        result = prime * result + ((getRulesTimeType() == null) ? 0 : getRulesTimeType().hashCode());
        result = prime * result + ((getRulesNum() == null) ? 0 : getRulesNum().hashCode());
        result = prime * result + ((getStep() == null) ? 0 : getStep().hashCode());
        result = prime * result + ((getNotes() == null) ? 0 : getNotes().hashCode());
        result = prime * result + ((getInsertPerson() == null) ? 0 : getInsertPerson().hashCode());
        result = prime * result + ((getInsertTime() == null) ? 0 : getInsertTime().hashCode());
        result = prime * result + ((getUpdatePerson() == null) ? 0 : getUpdatePerson().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", rulesId=").append(rulesId);
        sb.append(", rulesFromname=").append(rulesFromname);
        sb.append(", rulesLetter=").append(rulesLetter);
        sb.append(", rulesTimeType=").append(rulesTimeType);
        sb.append(", rulesNum=").append(rulesNum);
        sb.append(", step=").append(step);
        sb.append(", notes=").append(notes);
        sb.append(", insertPerson=").append(insertPerson);
        sb.append(", insertTime=").append(insertTime);
        sb.append(", updatePerson=").append(updatePerson);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}